package br.sales.entity;

import java.io.Serializable;

public class DynamicQuery implements Serializable{

	private static final long serialVersionUID = 1L;
	public static final int LIKE = 1;
	public static final int EQUAL = 2;
	public static final int GREATER = 4;
	public static final int SMALLER = 5;
	public static final int ENDSWITH = 6;
	public static final int CONTAINS = 7;
	public static final int STARTSWITH = 8;
	
	
	
	public static final int NONE = 0;
	public static final int AND = 1;
	public static final int OR = 2;
	
	private boolean not = false;
	private int type = LIKE;
	private int orOrAnd = NONE;
	private String descend;
	private Object constrain;
	
	public DynamicQuery(int like2, String string, String value, int or2) {
	}
	
	
	public String getDescend() {
		return descend;
	}


	public void setDescend(String descend) {
		this.descend = descend;
	}


	public Object getConstrain() {
		return constrain;
	}


	public void setConstrain(Object constrain) {
		this.constrain = constrain;
	}


	public int getOrOrAnd() {
		return orOrAnd;
	}


	public void setOrOrAnd(int orOrAnd) {
		this.orOrAnd = orOrAnd;
	}


	public DynamicQuery(int type, int orOrAnd, String descend, Object constrain) {
		super();
		this.type = type;
		this.orOrAnd = orOrAnd;
		this.descend = descend;
		this.constrain = constrain;
	}


	public DynamicQuery(int type, String descend, Object constrain) {
		this.type = type;
		this.descend = descend;
		this.constrain = constrain;
	}


	public boolean isNot() {
		return not;
	}


	public void setNot(boolean not) {
		this.not = not;
	}


	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	
	@Override
	public String toString() {
		return this.getDescend()+" - "+this.getConstrain().toString()+" - "+this.type+" - "+this.orOrAnd;
	}

}
